package com.wn.work;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author yellow Docter
 * @date 2023 -02-28
 * @desc
 *
 * @controller 处理请求
 * @service    服务层
 *
 * Work01Provider 不是上面的2个
 *
 */
@Component
public class Work02Provider {

    /**
     * RabbitTemplate MQ 发送消息的模板 (Springboot 封装的MQ给我们使用)
     *                  redidTemplate
     *                  SMSTemplate
     */
    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void send(String msg){

        /**
         * 消息的发送:
         * 参数1:交换机
         * 参数2:路由
         * 参数3:消息
         */
        rabbitTemplate.convertAndSend("exchange-fanout","",msg);

    }
}
